import { http } from '@/utils/http'
  
// 用户储值信息
export const getBalanceApi = () => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/balance'
  })
}
// 用户是否存在支付密码
export const getHasPayPasswordApi = () => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/hasPayPassword'
  })
}
// 获取储值金额列表
export const getWalletListApi = () => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/list/activity'
  })
}
// 获取免密支付按钮状态
export const getPayPasswordFreeApi = () => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/payPasswordFree'
  })
}
// 修改免密支付按钮状态
export const updatePayPasswordFreeApi = (data: {payPasswordFree: number, password?: string}) => {
  return http<any>({
    method: 'POST',
    url: '/client/stored/payPasswordFree',
    data
  })
}
// 设置支付密码
export const setPayPasswordApi = (data: {firstPassword: string, secondPassword: string}) => {
  return http<any>({
    method: 'POST',
    url: '/client/stored/setPayPassword',
    data
  })
}
// 重置密码获取验证码
export const getCodeApi = () => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/resetPayPassword/code'
  })
}
// 重置密码校验输入的验证码
export const checkCodeApi = (data: {code: string}) => {
  return http<any>({
    method: 'POST',
    url: '/client/stored/resetPayPassword/code/verify',
    data
  })
}
// 获取余额变动明细列表
export const getRecordsListApi = (data: {type: number, date: string}) => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/bill/list',
    data
  })
}
// 创建充值订单
export const createRechargeOrderApi = (data: {activityId: number, activityDetailId: number}) => {
  return http<any>({
    method: 'POST',
    url: '/client/stored/recharge/settle',
    data
  })
}
// 调用充值接口
export const payRechargeApi = (data: {orderSn: string}) => {
  return http<any>({
    method: 'GET',
    url: '/client/stored/recharge/settle/payment',
    data
  })
}
// 余额支付
export const payBalanceApi = (data: {orderId: string, password?: string}) => {
  return http<any>({
    method: 'POST',
    url: '/client/pay/balance',
    data
  })
}